-
Couldn't load subscription status.
- Fork 54
Add the hook api #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the hook api #665
Conversation
This text disrupts other commands whenever a `plugins` directory is not available.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
This is an attempt to prevent the namespace test from failing.
Sleep a bit to allow simln to process
e4db78a to
97cad87
Compare
|
closed in favor of #670 |
Overview
This hooks system is intended to allow the user to extend Warnet with python code plugins which will have hooks into key points in the Warnet workflow.
For the user
This hooks API lets users write plugins that look like this:
The various decorators available to users can be found in the hooks_api.py file which is also found in the
pluginsdirectory.To get a
pluginsdirectory, simply runwarnet init, and warnet will generate one for you.For the Warnet developers
This new hooks system lets us decorate our internal Warnet functions with
@apilike this:Doing so causes Warnet to produce the corresponding
hooks_api.pyfile when the user runswarnet initFeedback
I am looking for feedback on this approach. Earlier I had considered authoring an abstract class/interface. After implementing the hooks system using decorators, I noticed that it became much easier to get new API endpoints.